package ru.ccfit.nsu.g7204.dronov.adPlatform;

import ru.ccfit.nsu.g7204.dronov.adPlatform.system.db.DBConnectionHolder;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Drongo
 * Date: 16.03.11
 * Time: 22:45
 * To change this template use File | Settings | File Templates.
 */
public class FeaturesFormController implements FeaturesFormListener{

    private FeaturesDBManager dbManager;

    public FeaturesFormController(DBConnectionHolder dbConnectionHolder) {
        dbManager=new FeaturesDBManager(dbConnectionHolder);
    }

    public void editFeature(int id, String newInfo) {
        dbManager.editFeature(id, newInfo);
    }

    public void delAll() {
        dbManager.delAll();
    }

    public void addFeature(String info) {
        dbManager.addFeature(info);
    }

    public void delFeature(int id) {
        dbManager.delFeature(id);
    }

    public List<Feature> getFeatureList() {
        return dbManager.getFeatureList();
    }

    public void updateDbInfo(DBConnectionHolder dbConnectionHolder)
    {
        dbManager=new FeaturesDBManager(dbConnectionHolder);
    }
}
